package com.mango9x.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class Utils {
	public static boolean isDeviceOnline(Context context) {
		boolean ret = true;
		ConnectivityManager cm = (ConnectivityManager) context
				.getSystemService(Context.CONNECTIVITY_SERVICE);
		NetworkInfo i = cm.getActiveNetworkInfo();
		if (i == null || (!i.isConnected()) || (!i.isAvailable())) {
			ret = false;
		}
		return ret;
	}
}
